﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NOMFinalSettlement.AppForm
{
    public partial class fAbout : Form
    {
        enum AnimateWindowFlags : uint
        {
            AW_HOR_POSITIVE = 0x00000001,
            AW_HOR_NEGATIVE = 0x00000002,
            AW_VER_POSITIVE = 0x00000004,
            AW_VER_NEGATIVE = 0x00000008,
            AW_CENTER = 0x00000010,
            AW_HIDE = 0x00010000,
            AW_ACTIVATE = 0x00020000,
            AW_SLIDE = 0x00040000,
            AW_BLEND = 0x00080000
        }

        [System.Runtime.InteropServices.DllImport("user32")]
        static extern bool AnimateWindow(IntPtr hwnd, int time, AnimateWindowFlags flags);

        public fAbout()
        {
            InitializeComponent();
        }

        private void fAbout_Load(object sender, EventArgs e)
        {

        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            this.Center(this);
            AnimateWindow(this.Handle, 500, AnimateWindowFlags.AW_CENTER);

        }
        protected override void OnClosing(CancelEventArgs e)
        {
            AnimateWindow(this.Handle, 500, AnimateWindowFlags.AW_ACTIVATE | AnimateWindowFlags.AW_CENTER | AnimateWindowFlags.AW_HOR_NEGATIVE | AnimateWindowFlags.AW_HIDE);
            base.OnClosing(e);
        }

        private void Center(System.Windows.Forms.Form form)
        {
            form.Location = new Point((Screen.PrimaryScreen.Bounds.Size.Width / 2) - (form.Size.Width / 2), (Screen.PrimaryScreen.Bounds.Size.Height / 2) - (form.Size.Height / 2));
        }

        private void fAbout_MouseClick(object sender, MouseEventArgs e)
        {
            this.Close();
        }
    }
}
